class Coordinate:
    x = 10
    y = -5
    z = 0
 
point1 = Coordinate() 
print(hasattr(point1, 'x'))
print(hasattr(point1, 'y'))
print(hasattr(point1, 'z'))
print(hasattr(point1, 'no'))  # 没有该属性

# class A:
#     pass
# class B(A):
#     pass

# class C(A):
#     pass  
# print(issubclass(C,B))    # 返回 True
# c = C()
# print(isinstance(c,C))    # 返回 True
# print(isinstance(c,(C,B,A)))    # 返回 True


# class Turtle:
#     def __init__(self, x):
#         self.num = x

# class Fish:
#     def __init__(self, x):
#         self.num = x

# class Pool:
#     def __init__(self, x, y):
#         self.turtle = Turtle(x)
#         self.fish = Fish(y)
#         self.a = Turtle(x+22)
#         self.b = Fish(y+30)

#     def print_num2(self):
#         print("水池里总共有乌龟 %d 只，小鱼 %d 条！" % (self.b.num, self.a.num))

#     def print_num(self):
#         print("水池里总共有乌龟 %d 只，小鱼 %d 条！" % (self.turtle.num, self.fish.num))

# p = Pool(1,30)
# p.print_num2()